﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJ.Data.WCF;
using PJ.Framework;

namespace PJ.Data.Inventory
{
    public class InventoryBarCodeWCFProxyProvider : EntityWCFProxyProvider<InventoryBarCodeProviderClient, IInventoryBarCodeWCFProvider, BaseInventoryBarCodeData, IInventoryBarCodeData>, IInventoryBarCodeProvider
    {
        public InventoryBarCodeWCFProxyProvider(IInventoryBarCodeCache<IInventoryBarCodeData> cache)
            : base(cache)
        {
        }


        public string[] GetFragments(string ownerId, GetDataMode mode)
        {
            if (ownerId == null || ownerId == "")
                throw new ArgumentNullException();
            try
            {
                return EntityFragmentWCFProxyProvider.GetFragments(ClientBase, Cache, "", ownerId, mode);
            }
            catch (Exception ex)
            {
                ClientBase = null;
                ExceptionManager.Handle(ex);
                throw;
            }
        }


        new IInventoryBarCodeCache Cache
        {
            get
            {
                return (IInventoryBarCodeCache)base.Cache;
            }
        }

    }
}

